//
//  MOWaitDoDetailViewController.m
//  MobileOffice
//
//  Created by 冰冰 on 2019/6/7.
//  Copyright © 2019 com.idolmedia. All rights reserved.
//

#import "MOWaitDoDetailViewController.h"
#import "MOWaitDoDetail_DoingViewController.h"
#import "MOWaitDoDetail_MainViewController.h"
#import "MOWaitDoDetail_IdeaViewController.h"
#import "MONoticeSendViewController.h"
#import "MOWaitDoDetail_DoingModel.h"
#import "MOSignPasswordView.h"
#import "MOWaitDoDetail_HuiQianViewController.h"

@interface MOWaitDoDetailViewController ()<SNPageTabViewDelegate>

@property(nonatomic,strong)SNPageTabView *pageTabView;
//处理详情数据数组
@property(nonatomic,strong)NSMutableArray *waitDoDetail_Doing_DataArray;
//处理详情领导批示数组
@property(nonatomic,strong)NSMutableArray *waitDoDetail_Doing_AgreeArray;
//处理详情意见数组
@property(nonatomic,strong)NSMutableArray *waitDoDetail_Doing_IdeaArray;
//正文附件数据数组
@property(nonatomic,strong)NSMutableArray *eaitDoDetail_Main_DataArray;
//意见
@property(nonatomic,copy)NSString *waitDoDetail_Doing_IdeaStr;
//我的意见
@property(nonatomic,copy)NSString *waitDoDetail_Idea_MyIdeaStr;
//审批说明
@property(nonatomic,copy)NSString *waitDoDetail_Idea_DescIdeaStr;
//标题
@property(nonatomic,copy)NSString *titleStr;


@property(nonatomic,strong)MOWaitDoDetail_DoingViewController *title_1VC;

@property(nonatomic,strong)MOWaitDoDetail_MainViewController *title_2VC;

@property(nonatomic,strong)MOWaitDoDetail_IdeaViewController *title_3VC;

@property(nonatomic,strong)MOWaitDoDetail_HuiQianViewController *title_4VC;


@end


@implementation MOWaitDoDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"公文详情";
    
    self.view.backgroundColor = [UIColor whiteColor];
        
    [self creatSegumentView];
    
    [self creatBottomView];
    
    [self getData];
    
    //主办意见
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(waitDoDetail_Doing_ideaNoti:) name:@"waitDoDetail_Doing_idea" object:nil];
    //我的意见
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(waitDoDetail_Idea_MyIdea:) name:@"waitDoDetail_Idea_MyIdea" object:nil];
    //审批说明
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(waitDoDetail_Idea_desc:) name:@"waitDoDetail_Idea_desc" object:nil];
}

-(void)creatSegumentView
{
    
    self.title_1VC = [[MOWaitDoDetail_DoingViewController alloc] init];
    self.title_1VC.waitModel = self.waitModel;
    self.title_1VC.view.backgroundColor = [UIColor whiteColor];
    
    self.title_2VC = [[MOWaitDoDetail_MainViewController alloc] init];
    self.title_2VC.waitModel = self.waitModel;
    self.title_2VC.view.backgroundColor = [UIColor whiteColor];
    
    self.title_3VC = [[MOWaitDoDetail_IdeaViewController alloc] init];
    self.title_3VC.waitModel = self.waitModel;
    self.title_3VC.view.backgroundColor = [UIColor whiteColor];
    
    [self addChildViewController:self.title_1VC];
    [self addChildViewController:self.title_2VC];
    [self addChildViewController:self.title_3VC];
    
    if ([self.waitModel.wdlx isEqualToString:@"收文处理单"]) {//收文
        _pageTabView = [[SNPageTabView alloc] initWithChildControllers:self.childViewControllers childTitles:@[@"处理详情", @"正文附件",@"处理意见"]];
    }else{
        self.title_4VC = [[MOWaitDoDetail_HuiQianViewController alloc]init];
        [self addChildViewController:self.title_4VC];
        _pageTabView = [[SNPageTabView alloc] initWithChildControllers:self.childViewControllers childTitles:@[@"处理详情", @"正文附件",@"处理意见",@"会签信息"]];
    }

    _pageTabView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-StatusBarAndNavigationBarHeight-50-TabbarSafeBottomMargin);
    _pageTabView.tabSize = CGSizeMake(SCREEN_WIDTH, 41);
    _pageTabView.tabItemFont = FONT_SIZE(14);
    _pageTabView.unSelectedColor = KBlackColor_919395;
    _pageTabView.selectedColor = KBlackColor_2A2A2A;
    _pageTabView.tabBackgroundColor = [UIColor whiteColor];
    _pageTabView.bodyBounces = NO;
    _pageTabView.titleStyle = SNPageTabTitleStyleDefault;
    _pageTabView.indicatorStyle = SNPageTabIndicatorStyleFollowText;
    _pageTabView.indicatorHeight = 2;
    _pageTabView.delegate = self;
    _pageTabView.selectedTabIndex = 0;
    _pageTabView.lineView.hidden = YES;
    [self.view addSubview:_pageTabView];
    
}


-(void)creatBottomView
{
    UIView *bottomView = [[UIView alloc]initWithFrame:CGRectMake(0, _pageTabView.bottom, SCREEN_WIDTH, 50+TabbarSafeBottomMargin)];
    bottomView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:bottomView];
    
    NSArray *titleArr = @[@" 发送",@" 保存",@" 办结",@" 退回"];
    NSArray *imageArr = @[@"fasong1",@"baocun1",@"banjie1",@"tuihui1"];
    NSArray *imageArr1 = @[@"fasong2",@"baocun2",@"banjie2",@"tuihui2"];
    CGFloat buttonW = SCREEN_WIDTH/4;
    for (int i = 0; i<4; i++) {
        UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(buttonW*i, 0, buttonW, 50)];
        button.titleLabel.font = FONT_SIZE(10);
        [button setTitle:titleArr[i] forState:UIControlStateNormal];
        [button setTitleColor:KBlueColor_2C94FF forState:UIControlStateHighlighted];
        [button setTitleColor:KBlackColor_2A2A2A forState:UIControlStateNormal];
        button.tag = i;
        [button addTarget:self action:@selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
        [button setImage:IMAGE(imageArr[i]) forState:UIControlStateNormal];
        [button setImage:IMAGE(imageArr1[i]) forState:UIControlStateHighlighted];
        [bottomView addSubview:button];
    }
}

//主办意见
-(void)waitDoDetail_Doing_ideaNoti:(NSNotification *)noti
{
    self.waitDoDetail_Doing_IdeaStr = noti.userInfo[@"text"];
}

//我的意见
-(void)waitDoDetail_Idea_MyIdea:(NSNotification *)noti
{
    self.waitDoDetail_Idea_MyIdeaStr = noti.userInfo[@"text"];
    
}

//审批说明
-(void)waitDoDetail_Idea_desc:(NSNotification *)noti
{
    self.waitDoDetail_Idea_DescIdeaStr = noti.userInfo[@"text"];
}

//发送 保存 办结 退回
-(void)clickButton:(UIButton *)sender
{
    __weak typeof (self)weakSelf = self;
    if (sender.tag==0) {//发送
        MONoticeSendViewController *vc = [[MONoticeSendViewController alloc]init];
        vc.waitModel = self.waitModel;
        vc.titleStr = self.titleStr;
        [self.navigationController pushViewController:vc animated:YES];
    }else if (sender.tag==1){//保存
        
        MOHintView *hintView = [[MOHintView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) andContentStr:@"确定要保存此公文？"];
        hintView.clickSureButtonBlock = ^{
            [weakSelf seaveData];
        };
        [WINDOW addSubview:hintView];
        
    }else if (sender.tag==2){//办结
        
        MOHintView *hintView = [[MOHintView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) andContentStr:@"确定要办结此公文？"];
        hintView.clickSureButtonBlock = ^{
            
            NSString *url = [NSString stringWithFormat:@"%@/%@?authorization=%@",ODPSDB_ODPSBJ_URL,weakSelf.waitModel.key,[NSString URLEncodedString:[MOUser sharedMOUser].token]];
            
            [PPNetworkHelper GET:url parameters:@{} success:^(id responseObject) {
                NSLog(@"待办办结：%@",responseObject);
                if ([responseObject[@"status"] integerValue]==1) {
                    [weakSelf.navigationController popViewControllerAnimated:YES];
                    [[NSNotificationCenter defaultCenter]postNotificationName:@"officeTextStatusChange" object:nil];
                }
                [[ADShowMessage shareShowMessage]showTextOnly:responseObject[@"msg"] showInView:weakSelf.view];
                
            } failure:^(NSError *error) {
                NSLog(@"待办办结：%@",[error localizedDescription]);
            }];
            
        };
        [WINDOW addSubview:hintView];
        
    }else if (sender.tag==3){//退回
        
        MOHintView *hintView = [[MOHintView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) andContentStr:@"确定要退回此公文？"];
        hintView.clickSureButtonBlock = ^{

            NSString *url = [NSString stringWithFormat:@"%@/%@?authorization=%@",ODPSDB_ODPSRETURN_URL,weakSelf.waitModel.key,[NSString URLEncodedString:[MOUser sharedMOUser].token]];
            
            [PPNetworkHelper GET:url parameters:@{} success:^(id responseObject) {
                NSLog(@"待办办结：%@",responseObject);
                if ([responseObject[@"status"] integerValue]==1) {
                    [weakSelf.navigationController popViewControllerAnimated:YES];
                    [[NSNotificationCenter defaultCenter]postNotificationName:@"officeTextStatusChange" object:nil];
                }
                [[ADShowMessage shareShowMessage]showTextOnly:responseObject[@"msg"] showInView:weakSelf.view];
                
            } failure:^(NSError *error) {
                NSLog(@"待办办结：%@",[error localizedDescription]);
            }];

        };
        [WINDOW addSubview:hintView];
        
    }
}

-(void)seaveData
{
    if (self.pageTabView.selectedTabIndex==0) {
        if (self.waitDoDetail_Doing_IdeaStr.length==0) {
            [[ADShowMessage shareShowMessage]showTextOnly:@"请输入注办意见" showInView:self.view];
            return;
        }else{
            
            NSString *url = [NSString stringWithFormat:@"%@/%@?authorization=%@",ODPSDB_ODPSSAVEZBYJ_URL,self.waitModel.key,[NSString URLEncodedString:[MOUser sharedMOUser].token]];
            [MBProgressHUD showHUDAddedTo:self.view animated:YES];
            [PPNetworkHelper GET:url parameters:@{@"yj":self.waitDoDetail_Doing_IdeaStr} success:^(id responseObject) {
                NSLog(@"公文待办保存注办意见：%@",responseObject);
                [MBProgressHUD hideHUDForView:self.view animated:YES];
                if ([responseObject[@"status"] integerValue]==1) {
                    [[NSNotificationCenter defaultCenter]postNotificationName:@"officeTextStatusChange" object:nil];
                }
                [[ADShowMessage shareShowMessage]showTextOnly:responseObject[@"msg"] showInView:self.view];
                
            } failure:^(NSError *error) {
                [MBProgressHUD hideHUDForView:self.view animated:YES];
                NSLog(@"公文待办保存注办意见：%@",[error localizedDescription]);
            }];
        }
    }else if (self.pageTabView.selectedTabIndex==2){
        
        if (self.waitDoDetail_Idea_MyIdeaStr.length==0) {
            [[ADShowMessage shareShowMessage]showTextOnly:@"请选择你的意见" showInView:self.view];
            return;
        }
//        if (self.waitDoDetail_Idea_DescIdeaStr.length==0) {
//            [[ADShowMessage shareShowMessage]showTextOnly:@"请输入审批说明" showInView:self.view];
//            return;
//        }
        
        if ([self.waitModel.comeStr isEqualToString:@"办理并注办"]||[self.waitModel.comeStr isEqualToString:@"部门传阅"]) {
            NSString *url = [NSString stringWithFormat:@"%@/%@?yj=%@&authorization=%@",ODPSDB_ODPSSAVEZBYJ_URL,self.waitModel.key,self.waitDoDetail_Doing_IdeaStr,[NSString URLEncodedString:[MOUser sharedMOUser].token]];
            [MBProgressHUD showHUDAddedTo:self.view animated:YES];
            [PPNetworkHelper GET:url parameters:@{} success:^(id responseObject) {
                NSLog(@"公文待办保存注办意见：%@",responseObject);
                [MBProgressHUD hideHUDForView:self.view animated:YES];
                if ([responseObject[@"status"] integerValue]==1) {
                    [[NSNotificationCenter defaultCenter]postNotificationName:@"officeTextStatusChange" object:nil];
                }
                [[ADShowMessage shareShowMessage]showTextOnly:responseObject[@"msg"] showInView:self.view];
                
            } failure:^(NSError *error) {
                [MBProgressHUD hideHUDForView:self.view animated:YES];
                NSLog(@"公文待办保存注办意见：%@",[error localizedDescription]);
            }];
        }else{
            
            MOSignPasswordView *view = [[MOSignPasswordView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
            view.clickSureButtonBlock = ^(NSString * _Nonnull text) {

                NSString *url = [NSString stringWithFormat:@"%@?authorization=%@",ODPSDB_ODPSSAVEFWCLYJ_URL,[NSString URLEncodedString:[MOUser sharedMOUser].token]];
                
                NSDictionary *par = @{
                                      @"wjKey":self.waitModel.key,
                                      @"yj":self.waitDoDetail_Idea_MyIdeaStr,
                                      @"spsm":self.waitDoDetail_Idea_DescIdeaStr,
                                      @"qm":text
                                      };
                [PPNetworkHelper POST:url parameters:par success:^(id responseObject) {
                    NSLog(@"批办环节保存处理意见：%@",responseObject);
                    if ([responseObject[@"status"] integerValue]==1) {
                        [[NSNotificationCenter defaultCenter]postNotificationName:@"officeTextStatusChange" object:nil];
                    }
                    [[ADShowMessage shareShowMessage]showTextOnly:responseObject[@"msg"] showInView:self.view];
                } failure:^(NSError *error) {
                    NSLog(@"批办环节保存处理意见：%@",[error localizedDescription]);
                    [[ADShowMessage shareShowMessage]showTextOnly:[error localizedDescription] showInView:self.view];
                }];
                
            };
            [WINDOW addSubview:view];
        }
    }
}

-(void)getData
{
    self.waitDoDetail_Doing_DataArray = [NSMutableArray array];
    self.waitDoDetail_Doing_IdeaArray = [NSMutableArray array];
    self.waitDoDetail_Doing_AgreeArray = [NSMutableArray array];
    
    if ([self.waitModel.wdlx isEqualToString:@"收文处理单"]) {//收文
        
        NSString *url = [NSString stringWithFormat:@"%@/%@?authorization=%@",ODPSDB_ODPSQUERYSWCLD_URL,self.waitModel.key,[NSString URLEncodedString:[MOUser sharedMOUser].token]];
        
        [PPNetworkHelper GET:url parameters:@{} success:^(id responseObject) {
            NSLog(@"待办处理单详情（收文）：%@",responseObject);
            if ([responseObject[@"status"] integerValue]==1) {
                
                //待办详情---处理详情
                NSDictionary *dataDic = responseObject[@"swcld"][0];
                NSArray *titleArr = @[@"新疆税务局收支文处理单",@"缓急:",@"标题:",@"密级:",@"主办单位:",@"总收支号:",@"办理类型:",@"来文字号:",@"收文日期:",@"限办日期:",@"来文单位:",@"会办单位:",@"批注:",@"办理情况:"];
                self.titleStr = dataDic[@"bt"];
                for (int i=0; i<titleArr.count; i++) {
                    MOWaitDoDetail_DoingModel *model = [[MOWaitDoDetail_DoingModel alloc]init];
                    switch (i) {
                        case 0:
                            model.nameStr = @"新疆税务局收文处理单";
                            model.valueStr = @"";
                            model.isCenter = @"1";
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 1:
                            model.nameStr = @"缓急";
                            model.valueStr = dataDic[@"hj"];
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 2:
                            model.nameStr = titleArr[i];
                            model.valueStr = dataDic[@"bt"];
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 3:
                            model.nameStr = titleArr[i];
                            model.valueStr = dataDic[@"mj"];
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 4:
                            model.nameStr = titleArr[i];
                            model.valueStr = dataDic[@"zbdw"];
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 5:
                            model.nameStr = titleArr[i];
                            model.valueStr = dataDic[@"zswh"];
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 6:
                            model.nameStr = titleArr[i];
                            model.valueStr = dataDic[@"bllx"];
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 7:
                            model.nameStr = titleArr[i];
                            model.valueStr = dataDic[@"lwzh"];
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 8:
                            model.nameStr = titleArr[i];
                            model.valueStr = dataDic[@"swrq"];
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 9:
                            model.nameStr = titleArr[i];
                            model.valueStr = dataDic[@"xbrq"];
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 10:
                            model.nameStr = titleArr[i];
                            model.valueStr = dataDic[@"lwdw"];
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 11:
                            model.nameStr = titleArr[i];
                            model.valueStr = dataDic[@"hbdw"];
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 12:
                            model.nameStr = titleArr[i];
                            model.valueStr = dataDic[@"fz"];
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                        case 13:
                            model.nameStr = titleArr[i];
                            model.valueStr = @"";
                            model.hasTextField = @"1";
                            [self.waitDoDetail_Doing_DataArray addObject:model];
                            break;
                            
                        default:
                            break;
                    }
                }
                self.title_1VC.getDataArray = self.waitDoDetail_Doing_DataArray;
                
                //待办详情---注办意见
                NSArray *yyArrar = dataDic[@"zbyjList"];
                for (int i = 0; i<yyArrar.count; i++) {
                    [self.waitDoDetail_Doing_IdeaArray addObject:yyArrar[i]];
                }
                self.title_1VC.waitDoDetail_Doing_IdeaArray = self.waitDoDetail_Doing_IdeaArray;
                
                //待办详情领导批示
                //dataDic
                NSArray *agreeArray = dataDic[@"ldpslist"];
                for (int i = 0; i<agreeArray.count; i++) {
                    [self.waitDoDetail_Doing_AgreeArray addObject:agreeArray[i]];
                }
                self.title_1VC.waitDoDetail_Doing_AgressArray = self.waitDoDetail_Doing_AgreeArray;
                
                
                //待办详情---征文附件
                NSArray *fjArray = dataDic[@"fjlist"];
                self.eaitDoDetail_Main_DataArray = [NSMutableArray arrayWithArray:fjArray];
                self.title_2VC.eaitDoDetail_Main_DataArray = self.eaitDoDetail_Main_DataArray;
            }
            
        } failure:^(NSError *error) {
            NSLog(@"待办处理单详情（收文）：%@",[error localizedDescription]);
        }];
        
    }else{//发文
        
        NSString *url = [NSString stringWithFormat:@"%@/%@?authorization=%@",ODPSDB_ODPSQUERYFWCLD_URL,self.waitModel.key,[NSString URLEncodedString:[MOUser sharedMOUser].token]];
        
        [PPNetworkHelper GET:url parameters:@{} success:^(id responseObject) {
            NSLog(@"待办处理单详情（发文）：%@",responseObject);
            
            NSDictionary *dataDic = responseObject[@"twfz"];
            NSArray *titleArr = @[@"",@"缓急:",@"标题:",@"密级:",@"主办单位:",@"总收支号:",@"办理类型:",@"来文字号:",@"收文日期:",@"限办日期:",@"来文单位:",@"会办单位:",@"批注:",@"办理情况:",@"",@"",@"",@""];
            self.titleStr = dataDic[@"bt"];
            for (int i=0; i<titleArr.count; i++) {
                MOWaitDoDetail_DoingModel *model = [[MOWaitDoDetail_DoingModel alloc]init];
                switch (i) {
                    case 0:
                        model.nameStr = @"新疆税务局发文处理单";
                        model.valueStr = @"";
                        model.isCenter = @"1";
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 1:
                        model.nameStr = @"保密期限:";
                        model.valueStr = dataDic[@"bmqx"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 2:
                        model.nameStr = @"缓急:";
                        model.valueStr = dataDic[@"hj"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 3:
                        model.nameStr = @"发文字号:";
                        model.valueStr = dataDic[@"fwzh"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 4:
                        model.nameStr = @"签发:";
                        model.valueStr = dataDic[@"qf"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 5:
                        model.nameStr = @"初核:";
                        model.valueStr = dataDic[@"ch"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 6:
                        model.nameStr = @"主办部门:";
                        model.valueStr = dataDic[@"zbbm"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 7:
                        model.nameStr = @"拟稿人:";
                        model.valueStr = dataDic[@"ngr"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 8:
                        model.nameStr = @"电话:";
                        model.valueStr = dataDic[@"dh"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 9:
                        model.nameStr = @"拟稿日期:";
                        model.valueStr = dataDic[@"xbrq"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 10:
                        model.nameStr = @"审稿:";
                        model.valueStr = dataDic[@"sg"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 11:
                        model.nameStr = @"标题:";
                        model.valueStr = dataDic[@"bt"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 12:
                        model.nameStr = @"信息公开:";
                        model.valueStr = dataDic[@"xxgk"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 13:
                        model.nameStr = @"政策解读:";
                        model.valueStr = dataDic[@"zcjd"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 14:
                        model.nameStr = @"主送:";
                        model.valueStr = dataDic[@"zs"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 15:
                        model.nameStr = @"抄送:";
                        model.valueStr = dataDic[@"cs"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 16:
                        model.nameStr = @"附件:";
                        model.valueStr = dataDic[@"fj"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                    case 17:
                        model.nameStr = @"附注:";
                        model.valueStr = dataDic[@"fz"];
                        [self.waitDoDetail_Doing_DataArray addObject:model];
                        break;
                        
                    default:
                        break;
                }
                self.title_1VC.getDataArray = self.waitDoDetail_Doing_DataArray;
                
                //待办详情---征文附件
                NSArray *fjArray = responseObject[@"fj"];
                self.eaitDoDetail_Main_DataArray = [NSMutableArray arrayWithArray:fjArray];
                self.title_2VC.eaitDoDetail_Main_DataArray = self.eaitDoDetail_Main_DataArray;
                
                //处理意见
                NSArray *ideaA = responseObject[@"clyjObj"];
                self.title_3VC.waitIdeaArray = [NSMutableArray arrayWithArray:ideaA];
                
                //会签意见
                NSArray *huiQian = responseObject[@"hqyj"];
                self.title_4VC.huiQianDataArray = [NSMutableArray arrayWithArray:huiQian];
            }
            
        } failure:^(NSError *error) {
            NSLog(@"待办处理单详情（发文）：%@",[error localizedDescription]);
        }];
        
    }
}



@end
